﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Web;

namespace SnippetBox.Core.Common.Utilities {
    public class TrustUtility {
        public bool HasTrustLevel(AspNetHostingPermissionLevel level) {
            bool hasTrustLevel = true;
            try {
                new AspNetHostingPermission(level).Demand();
            }
            catch (SecurityException) {
                hasTrustLevel = false;
            }
            return hasTrustLevel;
        } 
    }
}
